home *** CD-ROM | disk | FTP | other *** search
- property pOrigMember, pMouseLoc, pSpr, pTilt, pTimer, pIngredient, pLiquidColor, pXbottle, pOrigIngredient, pPickItUp
- global gFloatSprite
-
- on beginSprite me
- pSpr = sprite(me.spriteNum)
- pOrigMember = pSpr.member
- pOrigIngredient = pIngredient
- mUseOrigBottle(me)
- end
-
- on mUseOrigBottle me
- pSpr.member = pOrigMember
- pIngredient = pOrigIngredient
- pLiquidColor = getLiquidColor(pIngredient)
- pXbottle = 0
- end
-
- on mUseXbottle me, xIngredient
- global gXbottleAlerts
- if xIngredient = pOrigIngredient then
- mUseOrigBottle(me)
- else
- pSpr.member = member("xbottle")
- pIngredient = xIngredient
- pLiquidColor = getLiquidColor(pIngredient)
- pXbottle = 1
- updateStage()
- if gXbottleAlerts[xIngredient] = 1 then
- gXbottleAlerts[xIngredient] = 2
- end if
- end if
- mPickMeUp(me)
- end
-
- on getPropertyDescriptionList me
- liquorList = [#sweetVermouth, #BITTERS, #dryVermouth, #milk, #SUGAR, #scotch, #bourbon, #whiskey, #kahfee, #tripleSec, #cocoRum, #melonLiquer, #raspberry, #grenadine, #lime, #vodka, #GIN, #rum, #tequila, #amaretto, #orange, #cranberry, #grapefruit, #pineapple, #lemon]
- myList = [#pIngredient: [#default: #vodka, #format: #symbol, #comment: "Ingredient:", #range: liquorList], #pTilt: [#default: #left, #comment: "Tilt", #format: #symbol, #range: [#left, #right]]]
- return myList
- end
-
- on mReplaceIt me
- pPickItUp = 0
- if pXbottle and not modifierDown() then
- mUseOrigBottle()
- end if
- pSpr.visible = 1
- end
-
- on rightMouseDown me
- global gXbottlePopup
- if the stage = the activeWindow then
- pMouseLoc = the clickLoc
- sendSprite(gXbottlePopup, #mShowPopup, pSpr, pOrigIngredient)
- end if
- end
-
- on mouseDown me
- global gXbottlePopup
- pPickItUp = 1
- if the doubleClick then
- exit
- end if
- if draggingAnything() then
- replaceDraggingAnything()
- else
- if modifierDown() then
- pMouseLoc = the clickLoc
- sendSprite(gXbottlePopup, #mShowPopup, pSpr, pOrigIngredient)
- exit
- end if
- menuDown = nowTicks()
- repeat while the stillDown
- updateStage()
- checkElapsedTime()
- if ticksSince(menuDown) > 60 then
- pMouseLoc = the clickLoc
- sendSprite(gXbottlePopup, #mShowPopup, pSpr, pOrigIngredient, pMouseLoc)
- exit
- next repeat
- end if
- if ticksSince(menuDown) > 10 then
- forceToolTip(pSpr, pIngredient, the clickLoc)
- end if
- end repeat
- mPickMeUp(me, 1)
- end if
- end
-
- on mPickMeUp me, noToolTip, pickupLoc
- global gFloatSprite
- replaceDraggingAnything()
- pPickItUp = 0
- if voidp(pickupLoc) then
- if the mouseV < pSpr.locV then
- pickupLoc = the mouseLoc
- else
- pickupLoc = pSpr.loc
- end if
- end if
- sendSprite(gFloatSprite, #mPickUpBottle, pSpr, 0, pLiquidColor, pIngredient, mGetPourSound(me), VOID, pickupLoc)
- if not noToolTip then
- forceToolTip(pSpr, pIngredient, point(pSpr.left, pSpr.top + (pSpr.height / 3)))
- end if
- end
-
- on mouseUp me
- global gQuickPlayMode
- if pPickItUp and gQuickPlayMode then
- mPickMeUp(me, 1)
- end if
- end
-
- on mGetPourSound me
- if pIngredient = #SUGAR then
- return "sugar_sound"
- else
- return VOID
- end if
- end
-
- on mouseEnter me
- if not draggingAnything() then
- pTimer = nowTicks()
- showToolTip(pSpr, pIngredient)
- end if
- end
-
- on mouseWithin
- if draggingAnything() then
- else
- if tipTickRange(pTimer) then
- forceToolTip(pSpr, pIngredient)
- else
- dismissToolTip()
- end if
- end if
- end
-
- on mouseLeave me
- if not draggingAnything() then
- hideToolTip()
- end if
- end
-